package Odhgos_Polhs;

public class Evaluation {
    
    //Attributes
    private int ID;
    private float quality;
    private float price;
    private float serviceTime;
    private float average;

    private Restaurant restaurant;  //Υλοποίηση σχέσης με Restaurant
    private RegUser user; //Υλοποίηση σχέσης με RegUser
    
    //Constructors
    public Evaluation(int ID, float quality, float price, float serviceTime, float average, Restaurant restaurant, RegUser user) {
        this.ID = ID;
        this.quality = quality;
        this.price = price;
        this.serviceTime = serviceTime;
        this.average = ((price+quality+serviceTime)/3);
        this.restaurant = restaurant;
        this.user = user;
    }
        
    //All Setters & Getters

    public int getID() {
        return ID;
    }

    public void setID(int ID) {
        this.ID = ID;
    }

    public float getAverage() {
        return average;
    }

    public void setAverage(float average) {
        this.average = average;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
        this.calcAverage();
    }

    public float getQuality() {
        return quality;
    }

    public void setQuality(float quality) {
        this.quality = quality;
        this.calcAverage();
    }

    public Restaurant getRestaurant() {
        return restaurant;
    }

    public void setRestaurant(Restaurant restaurant) {
        this.restaurant = restaurant;
    }

    public float getServiceTime() {
        return serviceTime;
    }

    public void setServiceTime(float serviceTime) {
        this.serviceTime = serviceTime;
        this.calcAverage();
    }

    public RegUser getUser() {
        return user;
    }

    public void setUser(RegUser user) {
        this.user = user;
    }
    
    //Other Methods
    public void calcAverage (){
        float p = this.price;
        float q = this.quality;
        float st = this.serviceTime;
        this.setAverage((p+q+st)/3);
        
    }

}// End Class Evaluation
